package com.tuanzi.loan.vo.response.statistics;

import com.tuanzi.loan.core.entity.Sort;
import com.tuanzi.loan.core.vo.IdentityResponse;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.Date;
import java.util.Objects;

/**
 * 活动参与统计 SearchResponse
 * @author JinRuiyang 2018/1/26 10:57:10
 */
@Data
@EqualsAndHashCode(callSuper=true)
public class ActivityParticipateStatSearchResponse extends IdentityResponse {

    private Date date;

    private String productName;

    private String parentId;

    private String channelName;

    private String channelGroup;

    private String platform;

    private String userType;

    private String adId;

    private String activityId;

    private String activityName;

    private String recommendType;
    
    private Integer exposure_pv;
    
    private Integer exposure_uv;

    private Integer detailUV;

    private Integer detailPV;

    private Integer participateUV;

    private Integer participatePV;

    @Sort(value = "show_pv")
    private Integer showPv;

    @Sort(value = "show_uv")
    private Integer showUv;

    @Sort(value = "click_pv")
    private Integer clickPv;

    @Sort(value = "click_uv")
    private Integer clickUv;

    private String participatePercent;

    private String key;

    public String getGroupKey(){
        if (Objects.isNull(key))
            this.key = String.format("%s|%s|%s|%s|%s|%s|%s|%s", date.getTime(), productName, channelName, platform, userType, adId, activityId, activityName);
        return key;
    }
}
